const Service = require('egg').Service

class editUserInfoService extends Service {
    async find() {
        let id = this.ctx.session.uid.ID
        const user=await this.ctx.model.Users.findById(id)
        return user
    }

    async UpData(data){
        const userId=await this.ctx.model.Users.findById(data.id)
        return userId
    }

    async Result(data,getData){
        const updata=await getData.update({
            userName: data.userName,
            profile: data.profile,
            avatar: data.url
        })

        return updata
    }
}

module.exports = editUserInfoService